from flask import session
from flask_migrate import MigrateCommand,Migrate
from flask_script import Manager

from logs.info import return_app,db

app = return_app('development')
# print(app)


#使用迁移框架和程序实例以及sqlchemy进行关联
Migrate(app,db)
#添加迁移命令
# 实例化Manage对象
manage = Manager(app)
# print(manage)
manage.add_command('db',MigrateCommand)

@app.route('/')
def index():
    session['name'] = 2018
    # print(index)
    return 'index'
# print(index)

if __name__ == '__main__':
    app.run()